<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <link rel="stylesheet" href="skin/base.css">
		<script src="js/config.js"></script>
		<script src="js/common.js"></script>
        <script src="js/zy_control.js"></script>
        <script src="js/zy_click.js"></script>
    </head>
    <body ontouchstart>
    	<div id="main" class="box-ver box">
			<div id="header">
				<header>
					<div id="toptype" class="tab">
	                	<div id="news" class="cur" ><span ontouchstart="zy_touch('down')" onclick="filter('news');">新闻</span></div>
						<div id="softupdate" ><span ontouchstart="zy_touch('down')" onclick="filter('softupdate');">软件更新</span></div>
						<div id="blog" ><span ontouchstart="zy_touch('down')" onclick="filter('blog');">博客</span></div>
						<div id="blog_recommend" ><span ontouchstart="zy_touch('down')" onclick="filter('blog_recommend');">推荐阅读</span></div>
					</div>
				</header>
			</div>
			<div id="content" class="loading"></div>
        	<div id="footer">
            	<ul>
            		<li class="cur"><div class="news"></div><span>综合</span></li>
					<li ontouchstart="zy_touch('down')" onclick="openage('post');"><div class="talk"></div><span>问答</span></li>
					<li ontouchstart="zy_touch('down')" onclick="openage('tweet');"><div class="life"></div><span>动弹</span></li>
					<li ontouchstart="zy_touch('down')" onclick="openage('life');"><div class="home"></div><span>我的</span></li>
					<li ontouchstart="zy_touch('down')" onclick="openage('more');"><div class="more"></div><span>更多</span></li>
                </ul>
        	</div>
		</div>
    </body>
    <script>
    	zy_init();
		
		
		function openage(url){
			var winname = url=='index'?'root':url;
			uexWindow.open(winname, '0', url+'.html', 0, '', '', 0x0);
		}
		
		function filter(id){
			var divs=$$('toptype').getElementsByTagName("div");
			for(var i=0;i<divs.length;i++)
			{
				 if(divs[i].id !=id)
				 {
				 	$$(divs[i].id).className='';
				 }else{
				 	$$(divs[i].id).className='cur';
				 }
			}
			zy_con("content", id+"_list.html", 0, $$("header").offsetHeight);
		}
		
		function loadindex(){
			zy_con("content", "news_list.html", 0, $$("header").offsetHeight);
			window.onorientationchange=window.onresize=function(){
				zy_resize("content",0,$$("header").offsetHeight);				
			}
		}
		
		
        window.uexOnload = function(type){
            if (!type) {
				uexXmlHttpMgr.onData = function(opId, status, data){
					uexXmlHttpMgr.close(opId);
					
					if (status == 1) {
						data=JSON.parse(data);
						if(opId==2){
							if (data['success'] == 'yes') {
								localStorage['skin'] = data['data']['skin'];
							}
						}
					}else if(status==-1){
						uexXmlHttpMgr.close(opId);
						uexWindow.toast("0","5",'加载失败',1000);
					}
				}
				loadindex();
								
				//推送开始
				//注册应用运行中Push事件通知函数
				uexWidget.setPushNotifyCallback("cbNotify");
				//注册获取硬件信息回调函数
				uexDevice.cbGetInfo = function(opCode, dataType, data){
					//alert("deviceToken=" + data);
				}
				//绑定当前用户信息到AppCan推送服务器
				setdeviceToken();
				//获取当前应用的DeviceToken
				uexDevice.getInfo('11');
				//注册获取Push消息内容的回调函数
				uexWidget.cbGetPushInfo = function(opCode, dataType, data){
					if(data){
						data = eval('('+data+')');
						// 下面写具体的处理
					}
				}
				//获取应用由Push激活时的Push消息内容
				uexWidget.getPushInfo();
            }
        }
		
		//推送开始
		function setdeviceToken(){
			//绑定用户UID和用户昵称到AppCan后台服务器
	 		uexWidget.setPushInfo("windeidolon","");
		}

		function cbNotify(){
			//alert("cbNotify");
			//当运行时收到Push消息后，获取Push消息内容
			uexWidget.getPushInfo();
		}

		function logger(s){
			var l=document.createElement("li");
			l.innerText = s;
			document.getElementById("logger").appendChild(l);
		}
		//推送结束
		
		
    </script>
</html>